home *** CD-ROM | disk | FTP | other *** search
- on playAmbientSound
- global gAmbientSound, gOverrideSoundPlaying
- if gAmbientSound = #null then
- exit
- end if
- if soundBusy(2) then
- exit
- end if
- set gOverrideSoundPlaying to 0
- sound playFile 2, gAmbientSound
- end
-
- on setAmbientSound soundFileName
- global gAmbientSoundName, gAmbientSound, gSoundPath, gOverrideSoundPlaying, gSoundOn
- set gOverrideSoundPlaying to 0
- if soundFileName = #null then
- if soundBusy(2) then
- sound stop 2
- end if
- set gAmbientSound to #null
- exit
- end if
- set gAmbientSoundName to soundFileName
- if gSoundOn then
- set ss to fixPath(gSoundPath & soundFileName)
- if ss <> gAmbientSound then
- sound stop 2
- set gAmbientSound to ss
- sound playFile 2, ss
- end if
- end if
- end
-
- on playOverrideSound soundFileName
- global gSoundPath, gOverrideSoundPlaying
- set ss to fixPath(gSoundPath & soundFileName)
- sound stop 2
- sound playFile 2, ss
- set gOverrideSoundPlaying to 1
- end
-
- on stopOverrideSound
- global gOverrideSoundPlaying
- if gOverrideSoundPlaying then
- sound stop 2
- set gOverrideSoundPlaying to 0
- end if
- end
-
- on fixPath str
- if the machineType = 256 then
- set ll to length(str)
- repeat with i = 3 to ll
- if char i of str = ":" then
- put "\" into char i of str
- end if
- end repeat
- end if
- return str
- end
-